-
Notifications
You must be signed in to change notification settings - Fork 3
Add measurement-set command
#316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This PR came up while I was doing some debugging for manufacturing programming and I figure if I wanted it once we will probably want it again |
ac70b56 to
9c4ad21
Compare
verifier/src/lib.rs
Outdated
|
|
||
| impl std::iter::IntoIterator for MeasurementSet { | ||
| type Item = Measurement; | ||
| type IntoIter = <std::collections::HashSet<attest_data::Measurement> as std::iter::IntoIterator>::IntoIter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what rust suggested, it's possible I could do this in a less obfuscated way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way is to define an Iterator for MeasurementSet and then impl IntoIterator in terms of that. This seems fine though, and is less code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HashSet is already in scope here so you save some characters by dropping the std::collections
verifier-cli/src/main.rs
Outdated
| } | ||
|
|
||
| fn measurement_set(attest: &dyn Attest) -> Result<MeasurementSet> { | ||
| // get log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: probably don't need this comment
verifier/src/lib.rs
Outdated
|
|
||
| impl std::iter::IntoIterator for MeasurementSet { | ||
| type Item = Measurement; | ||
| type IntoIter = <std::collections::HashSet<attest_data::Measurement> as std::iter::IntoIterator>::IntoIter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way is to define an Iterator for MeasurementSet and then impl IntoIterator in terms of that. This seems fine though, and is less code.
flihp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
It's useful to see what the current set of measurements is on device
9c4ad21 to
00b9921
Compare
It's useful to see what the current set of measurements is on device